<ion-view class="my-view">
  <ion-nav-bar class="bar bar-positive"></ion-nav-bar>
  <ion-nav-buttons side="left">
    <a class="button button-icon icon ion-chevron-left" ng-click="goBack()"></a>
  </ion-nav-buttons>
  <ion-nav-title class="my-view-title">注册Your Map账号</ion-nav-title>
  <ion-content>
    <form name="registerForm" novalidate>
      <div class="list register-block">
        <label class="item item-input register-input">
          <span class="input-label">用户名：</span>
          <input name="registerUsername" ng-model="registerUsername" ng-pattern="/^(?!_)(?!.*?_$)[a-zA-Z0-9_]+$/" required type="text" placeholder="1-10位英文字母、数字、下划线">
        </label>
        <label class="item item-input register-input">
          <span class="input-label">昵称：</span>
          <input name="registerNickname" ng-model="registerNickName"  ng-minlength="1" ng-maxlength="10" required type="text" placeholder="大家如何称呼你(1-10位字符)">
        </label>
        <label class="item item-input register-input">
          <span class="input-label">密码：</span>
          <input name="registerPassword" ng-model="registerPassword" ng-pattern="/^[0-9_a-zA-Z]{6,16}$/" required type="password" placeholder="6-16位英文字母或数字">
        </label>
        <label class="item item-input register-input">
          <span class="input-label">确认密码：</span>
          <input name="registerConfirmPassword" ng-model="registerConfirmPassword" ng-pattern="/^[0-9_a-zA-Z]{6,16}$/" required type="password" placeholder="请再次输入密码">
        </label>
      </div>

      <div class="padding">
        <button class="button button-block button-positive" type="submit" ng-click="signup(registerForm,registerPassword==registerConfirmPassword)">注册</button>
        <button class="button button-block button-outline button-positive" ng-click="changeState('login')">已有账号</button>
      </div>
    </form>

  </ion-content>
</ion-view>
